import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 引入echarts主题文件
import chalk from '../public/static/theme/chalk'
import vintage from '../public/static/theme/vintage'
import westeros from '../public/static/theme/westeros'
// 引入echarts
import echarts from 'echarts'
// 引入axios
import axios from 'axios'
// 请求基准路径的配置
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/'
// 将axios挂载到Vue原型对象上,在别的组件中this.$http
Vue.prototype.$http = axios
// 全局注册echarts主题，需要时使用 echarts.init(dom, 'westeros') 创建图表，第二个参数即为刚才注册的主题名字。
const themeobj1 = chalk
echarts.registerTheme('chalk', themeobj1)
const themeobj2 = vintage
echarts.registerTheme('vintage', themeobj2)
const themeobj3 = westeros
echarts.registerTheme('westeros', themeobj3)

// 将全局的echarts对象挂载到Vue的原型对象上,别的组件中 this.$echarts
Vue.prototype.$echarts = echarts

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
